class Student:
    address = '上饶'  # 类属性

    def __init__(self, name, age):  # name,age为实例属性
        self.name = name
        self.age = age

    # 实例方法
    def info(self):
        print('My name is', self.name, ', age is ', self.age)

    # 类方法
    @classmethod
    def cm(cls):
        print('类方法')

    # 静态方法
    @staticmethod
    def sm():
        print('静态方法')


# 在类之外定义的称为函数，在类之内定义的称为方法
def drink():
    print('drink water')


stu = Student('YHSimon', 21)
stu2 = Student('ZiHan', 21)
print(stu.name)
print(stu.age)
stu.info()
Student.info(stu2)
Student.cm()
Student.sm()
